//
// Created by Castle-Moriarty on 2025/11/2.
//
#include <iostream>
using namespace std;

int& max_return_reference(int& a,int& b) {
    if (a > b) {
        return a;
    }else {
        return b;
    }
}

int main() {
    int a{15};
    int b{13};

    cout << "Before function call:" << endl;
    cout << "a : " << a << endl;
    cout << "b : " << b << endl;

    int& ref_max = max_return_reference(a,b);
    int val = max_return_reference(a,b);

    cout << "max: " << ref_max << endl;
    cout << "val : " << val << endl;

    ++ref_max;

    cout << endl;
    cout << "After function call:" << endl;
    cout << "a : " << a << endl;
    cout << "b : " << b << endl;


    return 0;
}